#ifndef _NE_UI_LABEL_H_
#define _NE_UI_LABEL_H_

#include <UI/UIObject.h>

namespace ne
{
    class NEAPI UILabel : public UIObject
    {
        public:
            explicit UILabel(const std::string &name="UILabel");

            // Text Color
            virtual void setTextColor(const Color &color);
            virtual Color getTextColor() const;

            virtual void setTextAlpha(const real alpha);
            virtual real getTextAlpha() const;

            virtual void setFontLayout(const FontLayout layout);
            virtual FontLayout getFontLayout() const;

            virtual void setText(const std::string &text);
            virtual void setText(const Unicode &text);
            virtual const Unicode& getText() const;

            virtual void needTextUpdate();

            virtual void updateText(const bool forceUpdate=false);

            virtual ~UILabel();

        protected:
            virtual bool _updateSelf();

            virtual bool _renderSelf();

            virtual void _genFontGeometry(const DynamicGeometryPtr &pGeometry, const FontPtr &pFont);

        protected:
            Color mTextColor;
            FontLayout mFontLayout;
            Unicode mText;
            mutable real mTextOffset;
            mutable bool mNeedTextUpdate;
    };
}

#endif
